home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / AOCE folder / OCEMessaging.lisp < prev    next >
Encoding:
Text File  |  1994-09-12  |  36.1 KB  |  1,189 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; ***********************************************************
  3. ; Created: Monday, November 8, 1993 11:57AM
  4. ;  OCEMessaging.p
  5. ;  Pascal Interface to the Macintosh Libraries
  6. ;   Copyright Apple Computer, Inc. 1990-1993
  7. ;   All rights reserved
  8. ; ***********************************************************
  9.  
  10. ; $IFC UNDEFINED UsingIncludes
  11. ; $SETC UsingIncludes:= 0
  12. ; $ENDC
  13.  
  14. ; $IFC NOT UsingIncludes
  15.  
  16. ; $ENDC
  17.  
  18. ; $IFC UNDEFINED UsingOCEMessaging
  19. ; $SETC UsingOCEMessaging:= 1
  20.  
  21. ; $I+
  22. ; $SETC OCEMessagingIncludes:= UsingIncludes
  23. ; $SETC UsingIncludes:= 1
  24.  
  25. ; $IFC UNDEFINED UsingDigitalSignature
  26. ; $I DigitalSignature.p
  27. ; $ENDC
  28.  
  29. ; $IFC UNDEFINED UsingFiles
  30.  
  31. (require-interface 'FILES)      ; $I $$Shell(PInterfaces)Files.p
  32. ; $ENDC
  33.  
  34. ; $IFC UNDEFINED UsingOCE
  35. ; $I OCE.p
  36. ; $ENDC
  37.  
  38. ; $IFC UNDEFINED UsingOCEAuthDir
  39. ; $I OCEAuthDir.p
  40. ; $ENDC
  41.  
  42. ; $IFC UNDEFINED UsingTypes
  43.  
  44. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  45. ; $ENDC
  46.  
  47. ; $SETC UsingIncludes:= OCEMessagingIncludes
  48.  
  49. ; ****************************************************************************
  50. ;  Definitions common to OCEMessaging and to OCEMail. These relate to addressing,
  51. ; message ids and priorities, etc. 
  52.  
  53. ;  Values of IPMPriority 
  54.  
  55. (defconstant $kIPMAnyPriority 0);  FOR FILTER ONLY 
  56. (defconstant $kIPMNormalPriority 1)
  57.  
  58. (def-mactype :IPMPRIORITY (find-mactype :UNSIGNED-BYTE))
  59.  
  60. ;  Values of IPMAccessMode 
  61. (defconstant $kIPMAtMark 0)
  62. (defconstant $kIPMFromStart 1)
  63. (defconstant $kIPMFromLEOM 2)
  64. (defconstant $kIPMFromMark 3)
  65.  
  66. (def-mactype :IPMACCESSMODE (find-mactype :SIGNED-INTEGER))
  67.  
  68. (defconstant $kIPMUpdateMsgBit 4)
  69. (defconstant $kIPMNewMsgBit 5)
  70. (defconstant $kIPMDeleteMsgBit 6)
  71.  
  72. ;  Values of IPMNotificationType 
  73. (defconstant $kIPMUpdateMsgMask #X10); 1<<kIPMUpdateMsgBit
  74. (defconstant $kIPMNewMsgMask #X20); 1<<kIPMNewMsgBit
  75. (defconstant $kIPMDeleteMsgMask #X40); 1<<kIPMDeleteMsgBit
  76.  
  77. (def-mactype :IPMNOTIFICATIONTYPE (find-mactype :UNSIGNED-BYTE))
  78.  
  79. ;  Values of IPMSenderTag 
  80. (defconstant $kIPMSenderRStringTag 0)
  81. (defconstant $kIPMSenderRecordIDTag 1)
  82.  
  83. (def-mactype :IPMSENDERTAG (find-mactype :SIGNED-INTEGER))
  84.  
  85. (defconstant $kIPMFromDistListBit 0)
  86. (defconstant $kIPMDummyRecBit 1)
  87. (defconstant $kIPMFeedbackRecBit 2);  should be redirected to feedback queue 
  88. (defconstant $kIPMReporterRecBit 3);  should be redirected to reporter original queue 
  89. (defconstant $kIPMBCCRecBit 4)  ;  this recipient is blind to all recipients of message 
  90.  
  91. ;  Values of OCERecipientOffsetFlags 
  92. (defconstant $kIPMFromDistListMask #X1); 1<<kIPMFromDistListBit
  93. (defconstant $kIPMDummyRecMask #X2); 1<<kIPMDummyRecBit
  94. (defconstant $kIPMFeedbackRecMask #X4); 1<<kIPMFeedbackRecBit
  95. (defconstant $kIPMReporterRecMask #X8); 1<<kIPMReporterRecBit
  96. (defconstant $kIPMBCCRecMask #X10); 1<<kIPMBCCRecBit
  97.  
  98. (def-mactype :OCERECIPIENTOFFSETFLAGS (find-mactype :UNSIGNED-BYTE))
  99.  
  100. (defrecord OCECreatorType 
  101.    (msgCreator :OSTYPE)
  102.    (msgType :OSTYPE)
  103.    )
  104.  
  105. (defconstant $kIPMTypeWildCard :|ipmw|)
  106.  
  107. (defconstant $kIPMFamilyUnspecified 0)
  108. (defconstant $kIPMFamilyWildCard :|????|)
  109.  
  110. ;  well known signature 
  111. (defconstant $kIPMSignature :|ipms|);  base type 
  112.  
  113. ;  well known message types 
  114. (defconstant $kIPMReportNotify :|rptn|);  routing feedback 
  115.  
  116. ;  well known message block types 
  117. (defconstant $kIPMEnclosedMsgType :|emsg|);  enclosed (nested) message 
  118. (defconstant $kIPMReportInfo :|rpti|);  recipient information 
  119. (defconstant $kIPMDigitalSignature :|dsig|);  digital signature 
  120.  
  121. ;  Values of IPMMsgFormat 
  122. (defconstant $kIPMOSFormatType 1)
  123. (defconstant $kIPMStringFormatType 2)
  124.  
  125. (def-mactype :IPMMSGFORMAT (find-mactype :SIGNED-INTEGER))
  126.  
  127. (def-mactype :IPMSTRINGMSGTYPE (find-mactype :STRING))
  128.  
  129. (defrecord IPMMsgType 
  130.    (format :SIGNED-INTEGER)     ;  IPMMsgFormat
  131.    (:variant 
  132.       ((msgOSType :OCECREATORTYPE))
  133.       ((msgStrType (:STRING 32)))
  134.       ))
  135.  
  136. ; Following are the known extension values for IPM addresses handled by Apple.
  137. ; We define the definition of the entn extension below.
  138.  
  139. (defconstant $kOCEalanXtn :|alan|)
  140. (defconstant $kOCEentnXtn :|entn|);  entn = entity name (DSSpec: aka) 
  141. (defconstant $kOCEaphnXtn :|aphn|)
  142.  
  143. ; Following are the specific definitions for the extension for the standard
  144. ; OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in
  145. ; IPMEntityNameExtension.]
  146.  
  147. ;  entn extension forms 
  148. (defconstant $kOCEAddrXtn :|addr|)
  149. (defconstant $kOCEQnamXtn :|qnam|)
  150. (defconstant $kOCEAttrXtn :|attr|);  an attribute specification 
  151. (defconstant $kOCESpAtXtn :|spat|);  specific attribute 
  152.  
  153. ; Following are the specific definitions for standard
  154. ; OCEMail 'aphn' extension value.  
  155. ; All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
  156. ; if length odd, then a pad byte (zero) should be introduced before the next field).
  157. ; The extension value is in the packed form of the following structure:
  158. ;     RString        phoneNumber;
  159. ;     RString        modemType;
  160. ;     Str32        queueuName;
  161. ; The body of phoneNumber compound RString is in the packed form of the following structure:
  162. ;     short         subType;
  163. ;     RString     countryCode;                // used when subType == kOCEUseHandyDial
  164. ;     RString        areaCode;                    // used when subType == kOCEUseHandyDial
  165. ;     RString        phone;                        // used when subType == kOCEUseHandyDial
  166. ;     RString        postFix;                    // used when subType == kOCEUseHandyDial
  167. ;     RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial
  168.  
  169. ;  phoneNumber sub type constants 
  170.  
  171. (defconstant $kOCEUseHandyDial 1)
  172. (defconstant $kOCEDontUseHandyDial 2)
  173.  
  174. (defrecord ProtoOCEPackedRecipient 
  175.    (dataLength :SIGNED-INTEGER)
  176.    )
  177.  
  178. (defconstant $kOCEPackedRecipientMaxBytes (- 4096 (RECORD-LENGTH PROTOOCEPACKEDRECIPIENT)))
  179.  
  180. (defrecord OCEPackedRecipient 
  181.    (dataLength :SIGNED-INTEGER)
  182.  
  183.    (data (:ARRAY :UNSIGNED-BYTE 4094))
  184.    )
  185. (def-mactype :OCEPACKEDRECIPIENTPTR (find-mactype :POINTER))
  186.  
  187. (defrecord IPMEntnQueueExtension 
  188.    (queueName (:STRING 32))
  189.    )
  190.  
  191. (defrecord IPMEntnAttributeExtension ;  kOCEAttrXtn 
  192.    (attributeName :ATTRIBUTETYPE)
  193.    )
  194.  
  195. (defrecord IPMEntnSpecificAttributeExtension ;  kOCESpAtXtn 
  196.    (AttributeCreationID :CREATIONID)
  197.    (attributeName :ATTRIBUTETYPE)
  198.    )
  199.  
  200. ;  All IPM entn extensions fit within the following 
  201.  
  202. (defrecord IPMEntityNameExtension 
  203.    (subExtensionType :OSTYPE)
  204.    (:variant 
  205.       ((specificAttribute :IPMENTNSPECIFICATTRIBUTEEXTENSION))
  206.       ((attribute :IPMENTNATTRIBUTEEXTENSION))
  207.       ((queue :IPMENTNQUEUEEXTENSION))
  208.       ))
  209.  
  210. ;  addresses with kIPMNBPXtn should specify this nbp type 
  211.  
  212. (defconstant $kIPMWSReceiverNBPType "MsgReceiver")
  213.  
  214. (defrecord IPMMsgID 
  215.    (id (:ARRAY :SIGNED-LONG (- 4 1 -1)))
  216.    )
  217.  
  218. ;  Values of IPMHeaderSelector 
  219. (defconstant $kIPMTOC 0)
  220. (defconstant $kIPMSender 1)
  221. (defconstant $kIPMProcessHint 2)
  222. (defconstant $kIPMMessageTitle 3)
  223. (defconstant $kIPMMessageType 4)
  224. (defconstant $kIPMFixedInfo 7)
  225.  
  226. (def-mactype :IPMHEADERSELECTOR (find-mactype :UNSIGNED-BYTE))
  227.  
  228. (defrecord IPMSender 
  229.    (sendTag :SIGNED-INTEGER)
  230.    (:variant 
  231.       ((RString :RSTRING))
  232.       ((rid :PACKEDRECORDID))
  233.       ))
  234.  
  235. (%define-record :OCERECIPIENT (find-record-descriptor :DSSPEC))
  236.  
  237. ; ****************************************************************************
  238. ;  Definitions specific to OCEMessaging 
  239.  
  240. (def-mactype :IPMCONTEXTREF (find-mactype :SIGNED-LONG))
  241. (def-mactype :IPMQUEUEREF (find-mactype :SIGNED-LONG))
  242. (def-mactype :IPMMSGREF (find-mactype :SIGNED-LONG))
  243. (def-mactype :IPMSEQNUM (find-mactype :SIGNED-LONG))
  244. (def-mactype :IPMPROCHINT (find-mactype :STRING))
  245. (def-mactype :IPMQUEUENAME (find-mactype :STRING))
  246.  
  247. (def-mactype :IPMNOTEPROCPTR (find-mactype :POINTER))
  248. ;  FUNCTION IPMNoteProcPtr(queue: IPMQueueRef; seqNum: IPMSeqNum;
  249. ;          notificationType: IPMNotificationType; userData: LONGINT): void;
  250.  
  251. (defrecord IPMFixedHdrInfo 
  252.    (version :SIGNED-INTEGER)
  253.  
  254. ; ERROR!! Record field AUTHENTICATED declared PACKED BOOLEAN !
  255.    (authenticated :BOOLEAN)
  256.  
  257. ; ERROR!! Record field SIGNATUREENCLOSED declared PACKED BOOLEAN !
  258.    (signatureEnclosed :BOOLEAN) ;  digital signature enclosed 
  259.    (msgSize :SIGNED-LONG)
  260.    (notification :UNSIGNED-BYTE)
  261.    (priority :UNSIGNED-BYTE)
  262.    (blockCount :SIGNED-INTEGER)
  263.    (originalRcptCount :SIGNED-INTEGER);  original number of recipients 
  264.    (refCon :SIGNED-LONG)        ;  Client defined data 
  265.    (reserved :SIGNED-INTEGER)
  266.    (creationTime :SIGNED-LONG)  ;  Time when it was created 
  267.    (msgID :IPMMSGID)
  268.    (family :OSTYPE)             ;  family this msg belongs (e.g. mail) 
  269.    )
  270.  
  271. (defconstant $kIPMDeliveryNotificationBit 0)
  272. (defconstant $kIPMNonDeliveryNotificationBit 1)
  273. (defconstant $kIPMEncloseOriginalBit 2)
  274. (defconstant $kIPMSummaryReportBit 3)
  275. (defconstant $kIPMOriginalOnlyOnErrorBit 4);  modify enclose original to only on error 
  276.  
  277. (defconstant $kIPMNoNotificationMask #X0)
  278. (defconstant $kIPMDeliveryNotificationMask #X1); 1<<kIPMDeliveryNotificationBit
  279. (defconstant $kIPMNonDeliveryNotificationMask #X2); 1<<kIPMNonDeliveryNotificationBit
  280. (defconstant $kIPMDontEncloseOriginalMask #X0)
  281. (defconstant $kIPMEncloseOriginalMask #X4); 1<<kIPMEncloseOriginalBit
  282. (defconstant $kIPMImmediateReportMask #X0)
  283. (defconstant $kIPMSummaryReportMask #X8); 1<<kIPMSummaryReportBit
  284. (defconstant $kIPMOriginalOnlyOnErrorMask #X10); 1<<kIPMOriginalOnlyOnErrorBit
  285. (defconstant $kIPMEncloseOriginalOnErrorMask (+ #$KIPMORIGINALONLYONERRORMASK #$KIPMENCLOSEORIGINALMASK))
  286.  
  287. ;  standard Non delivery codes 
  288. (defconstant $kIPMNoSuchRecipient #X1)
  289. (defconstant $kIPMRecipientMalformed #X2)
  290. (defconstant $kIPMRecipientAmbiguous #X3)
  291. (defconstant $kIPMRecipientAccessDenied #X4)
  292. (defconstant $kIPMGroupExpansionProblem #X5)
  293. (defconstant $kIPMMsgUnreadable #X6)
  294. (defconstant $kIPMMsgExpired #X7)
  295. (defconstant $kIPMMsgNoTranslatableContent #X8)
  296. (defconstant $kIPMRecipientReqStdCont #X9)
  297. (defconstant $kIPMRecipientReqSnapShot #XA)
  298. (defconstant $kIPMNoTransferDiskFull #XB)
  299. (defconstant $kIPMNoTransferMsgRejectedbyDest #XC)
  300. (defconstant $kIPMNoTransferMsgTooLarge #XD)
  301.  
  302. ; ***********************************************************************
  303. ; This is the structure that will be returned by enumerate and getmsginfo
  304. ; This definition is just to give you a template, the position of msgType
  305. ; is variable since this is a packed structure.  procHint and msgType are
  306. ; packed and even length padded.
  307.  
  308. (defrecord IPMMsgInfo 
  309.    (sequenceNum :SIGNED-LONG)
  310.    (userData :SIGNED-LONG)
  311.    (respIndex :SIGNED-INTEGER)
  312.    (padByte :UNSIGNED-BYTE)
  313.    (priority :UNSIGNED-BYTE)
  314.    (msgSize :SIGNED-LONG)
  315.    (originalRcptCount :SIGNED-INTEGER)
  316.    (reserved :SIGNED-INTEGER)
  317.    (creationTime :SIGNED-LONG)
  318.    (msgID :IPMMSGID)
  319.    (family :OSTYPE)             ;  family this msg belongs to (e.g. mail) 
  320.    (procHint (:STRING 32))
  321.    (msgType :IPMMSGTYPE)
  322.    )
  323.  
  324. (%define-record :IPMBLOCKTYPE (find-record-descriptor :OCECREATORTYPE))
  325.  
  326. (defrecord IPMTOC 
  327.    (blockType :OCECREATORTYPE)
  328.    (blockOffset :SIGNED-LONG)
  329.    (blockSize :SIGNED-LONG)
  330.    (blockRefCon :SIGNED-LONG)
  331.    )
  332.  
  333. ; The following structure is just to describe the layout of the SingleFilter.
  334. ; Each field should be packed and word aligned when passed to the IPM ToolBox.
  335.  
  336. (defrecord IPMSingleFilter 
  337.    (priority :UNSIGNED-BYTE)
  338.    (padByte :UNSIGNED-BYTE)
  339.    (family :OSTYPE)             ;  family this msg belongs (e.g. mail), '????' for all 
  340.    (script :SIGNED-INTEGER)     ;  Language Identifier 
  341.    (hint (:STRING 32))
  342.    (msgType :IPMMSGTYPE)
  343.    )
  344.  
  345. (defrecord IPMFilter 
  346.    (count :SIGNED-INTEGER)
  347.    (sFilters (:ARRAY :IPMSINGLEFILTER (- 1 1 -1)))
  348.    )
  349.  
  350. ; ***********************************************************************
  351. ; Following structures define the “start” of a recipient report block and the
  352. ; elements of the array respectively.
  353.  
  354. (defrecord IPMReportBlockHeader 
  355.    (msgID :IPMMSGID)            ;  message id of the original 
  356.    (creationTime :SIGNED-LONG)  ;  creation time of the report 
  357.    )
  358.  
  359. (defrecord OCERecipientReport 
  360.    (rcptIndex :SIGNED-INTEGER)  ;  index of recipient in original message 
  361.    (result :SIGNED-INTEGER)     ;  result of sending letter to this recipient
  362.    )
  363.  
  364. ; ***********************************************************************
  365. (defrecord IPMParamHeader 
  366.    (qLink :POINTER)
  367.    (reservedH1 :SIGNED-LONG)
  368.    (reservedH2 :SIGNED-LONG)
  369.    (ioCompletion :POINTER)
  370.    (ioResult :SIGNED-INTEGER)
  371.    (saveA5 :SIGNED-LONG)
  372.    (reqCode :SIGNED-INTEGER)
  373.    )
  374.  
  375. (defrecord IPMOpenContextPB 
  376.    (qLink :POINTER)
  377.    (reservedH1 :SIGNED-LONG)
  378.    (reservedH2 :SIGNED-LONG)
  379.    (ioCompletion :POINTER)
  380.    (ioResult :SIGNED-INTEGER)
  381.    (saveA5 :SIGNED-LONG)
  382.    (reqCode :SIGNED-INTEGER)
  383.  
  384.    (contextRef :SIGNED-LONG)    ;  <--  Context reference to be used in further calls
  385.    )
  386.  
  387. (%define-record :IPMCLOSECONTEXTPB (find-record-descriptor :IPMOPENCONTEXTPB))
  388.  
  389. (defrecord IPMCreateQueuePB 
  390.    (qLink :POINTER)
  391.    (reservedH1 :SIGNED-LONG)
  392.    (reservedH2 :SIGNED-LONG)
  393.    (ioCompletion :POINTER)
  394.    (ioResult :SIGNED-INTEGER)
  395.    (saveA5 :SIGNED-LONG)
  396.    (reqCode :SIGNED-INTEGER)
  397.  
  398.    (filler1 :SIGNED-LONG)
  399.    (queue (:POINTER :DSSPEC))
  400.    (identity :SIGNED-LONG)      ;  used only if queue is remote 
  401.    (owner (:POINTER :PACKEDRECORDID));  used only if queue is remote 
  402.    )
  403.  
  404. ;  For createqueue and deletequeue only queue and identity are used 
  405. (%define-record :IPMDELETEQUEUEPB (find-record-descriptor :IPMCREATEQUEUEPB))
  406.  
  407. (defrecord IPMOpenQueuePB 
  408.    (qLink :POINTER)
  409.    (reservedH1 :SIGNED-LONG)
  410.    (reservedH2 :SIGNED-LONG)
  411.    (ioCompletion :POINTER)
  412.    (ioResult :SIGNED-INTEGER)
  413.    (saveA5 :SIGNED-LONG)
  414.    (reqCode :SIGNED-INTEGER)
  415.  
  416.    (contextRef :SIGNED-LONG)
  417.    (queue (:POINTER :DSSPEC))
  418.    (identity :SIGNED-LONG)
  419.    (filter (:POINTER :IPMFILTER))
  420.    (newQueueRef :SIGNED-LONG)
  421.    (notificationProc :POINTER)
  422.    (userData :SIGNED-LONG)
  423.    (noteType :UNSIGNED-BYTE)
  424.    (padByte :UNSIGNED-BYTE)
  425.    (reserved :SIGNED-LONG)
  426.    (reserved2 :SIGNED-LONG)
  427.    )
  428.  
  429. (defrecord IPMCloseQueuePB 
  430.    (qLink :POINTER)
  431.    (reservedH1 :SIGNED-LONG)
  432.    (reservedH2 :SIGNED-LONG)
  433.    (ioCompletion :POINTER)
  434.    (ioResult :SIGNED-INTEGER)
  435.    (saveA5 :SIGNED-LONG)
  436.    (reqCode :SIGNED-INTEGER)
  437.  
  438.    (queueRef :SIGNED-LONG)
  439.    )
  440.  
  441. (defrecord IPMEnumerateQueuePB 
  442.    (qLink :POINTER)
  443.    (reservedH1 :SIGNED-LONG)
  444.    (reservedH2 :SIGNED-LONG)
  445.    (ioCompletion :POINTER)
  446.    (ioResult :SIGNED-INTEGER)
  447.    (saveA5 :SIGNED-LONG)
  448.    (reqCode :SIGNED-INTEGER)
  449.  
  450.    (queueRef :SIGNED-LONG)
  451.    (startSeqNum :SIGNED-LONG)
  452.    (getProcHint :BOOLEAN)
  453.    (getMsgType :BOOLEAN)
  454.    (filler :SIGNED-INTEGER)
  455.    (filter (:POINTER :IPMFILTER))
  456.    (numToGet :SIGNED-INTEGER)
  457.    (numGotten :SIGNED-INTEGER)
  458.    (enumCount :SIGNED-LONG)
  459.    (enumBuffer :POINTER)        ;  will be packed array of IPMMsgInfo 
  460.    (actEnumCount :SIGNED-LONG)
  461.    )
  462.  
  463. (%define-record :IPMCHANGEQUEUEFILTERPB (find-record-descriptor :IPMENUMERATEQUEUEPB))
  464.  
  465. (defrecord IPMDeleteMsgRangePB 
  466.    (qLink :POINTER)
  467.    (reservedH1 :SIGNED-LONG)
  468.    (reservedH2 :SIGNED-LONG)
  469.    (ioCompletion :POINTER)
  470.    (ioResult :SIGNED-INTEGER)
  471.    (saveA5 :SIGNED-LONG)
  472.    (reqCode :SIGNED-INTEGER)
  473.  
  474.    (queueRef :SIGNED-LONG)
  475.    (startSeqNum :SIGNED-LONG)
  476.    (endSeqNum :SIGNED-LONG)
  477.    (lastSeqNum :SIGNED-LONG)
  478.    )
  479.  
  480. (defrecord IPMOpenMsgPB 
  481.    (qLink :POINTER)
  482.    (reservedH1 :SIGNED-LONG)
  483.    (reservedH2 :SIGNED-LONG)
  484.    (ioCompletion :POINTER)
  485.    (ioResult :SIGNED-INTEGER)
  486.    (saveA5 :SIGNED-LONG)
  487.    (reqCode :SIGNED-INTEGER)
  488.  
  489.    (queueRef :SIGNED-LONG)
  490.    (sequenceNum :SIGNED-LONG)
  491.    (newMsgRef :SIGNED-LONG)
  492.    (actualSeqNum :SIGNED-LONG)
  493.  
  494. ; ERROR!! Record field EXACTMATCH declared PACKED BOOLEAN !
  495.    (exactMatch :BOOLEAN)
  496.    (padByte :UNSIGNED-BYTE)
  497.    (reserved :SIGNED-LONG)
  498.    )
  499.  
  500. (defrecord IPMOpenHFSMsgPB 
  501.    (qLink :POINTER)
  502.    (reservedH1 :SIGNED-LONG)
  503.    (reservedH2 :SIGNED-LONG)
  504.    (ioCompletion :POINTER)
  505.    (ioResult :SIGNED-INTEGER)
  506.    (saveA5 :SIGNED-LONG)
  507.    (reqCode :SIGNED-INTEGER)
  508.  
  509.    (hfsPath (:POINTER :FSSPEC))
  510.    (filler :SIGNED-LONG)
  511.    (newMsgRef :SIGNED-LONG)
  512.    (filler2 :SIGNED-LONG)
  513.  
  514. ; ERROR!! Record field FILLER3 declared Non-PACKED BYTE !
  515.    (filler3 :UNSIGNED-BYTE)
  516.    (reserved :SIGNED-LONG)
  517.    )
  518.  
  519. (defrecord IPMOpenBlockAsMsgPB 
  520.    (qLink :POINTER)
  521.    (reservedH1 :SIGNED-LONG)
  522.    (reservedH2 :SIGNED-LONG)
  523.    (ioCompletion :POINTER)
  524.    (ioResult :SIGNED-INTEGER)
  525.    (saveA5 :SIGNED-LONG)
  526.    (reqCode :SIGNED-INTEGER)
  527.  
  528.    (msgRef :SIGNED-LONG)
  529.    (filler :SIGNED-LONG)
  530.    (newMsgRef :SIGNED-LONG)
  531.    (filler2 (:ARRAY :SIGNED-INTEGER (- 7 1 -1)))
  532.    (blockIndex :SIGNED-INTEGER)
  533.    )
  534.  
  535. (defrecord IPMCloseMsgPB 
  536.    (qLink :POINTER)
  537.    (reservedH1 :SIGNED-LONG)
  538.    (reservedH2 :SIGNED-LONG)
  539.    (ioCompletion :POINTER)
  540.    (ioResult :SIGNED-INTEGER)
  541.    (saveA5 :SIGNED-LONG)
  542.    (reqCode :SIGNED-INTEGER)
  543.  
  544.    (msgRef :SIGNED-LONG)
  545.    (deleteMsg :BOOLEAN)
  546.    )
  547.  
  548. (defrecord IPMGetMsgInfoPB 
  549.    (qLink :POINTER)
  550.    (reservedH1 :SIGNED-LONG)
  551.    (reservedH2 :SIGNED-LONG)
  552.    (ioCompletion :POINTER)
  553.    (ioResult :SIGNED-INTEGER)
  554.    (saveA5 :SIGNED-LONG)
  555.    (reqCode :SIGNED-INTEGER)
  556.  
  557.    (msgRef :SIGNED-LONG)
  558.    (info (:POINTER :IPMMSGINFO))
  559.    )
  560.  
  561. (defrecord IPMReadHeaderPB 
  562.    (qLink :POINTER)
  563.    (reservedH1 :SIGNED-LONG)
  564.    (reservedH2 :SIGNED-LONG)
  565.    (ioCompletion :POINTER)
  566.    (ioResult :SIGNED-INTEGER)
  567.    (saveA5 :SIGNED-LONG)
  568.    (reqCode :SIGNED-INTEGER)
  569.  
  570.    (msgRef :SIGNED-LONG)
  571.    (fieldSelector :SIGNED-INTEGER)
  572.    (offset :SIGNED-LONG)
  573.    (count :SIGNED-LONG)
  574.    (buffer :POINTER)
  575.    (actualCount :SIGNED-LONG)
  576.    (filler :SIGNED-INTEGER)
  577.    (remaining :SIGNED-LONG)
  578.    )
  579.  
  580. (defrecord IPMReadRecipientPB 
  581.    (qLink :POINTER)
  582.    (reservedH1 :SIGNED-LONG)
  583.    (reservedH2 :SIGNED-LONG)
  584.    (ioCompletion :POINTER)
  585.    (ioResult :SIGNED-INTEGER)
  586.    (saveA5 :SIGNED-LONG)
  587.    (reqCode :SIGNED-INTEGER)
  588.  
  589.    (msgRef :SIGNED-LONG)
  590.    (rcptIndex :SIGNED-INTEGER)
  591.    (offset :SIGNED-LONG)
  592.    (count :SIGNED-LONG)
  593.    (buffer :POINTER)
  594.    (actualCount :SIGNED-LONG)
  595.    (reserved :SIGNED-INTEGER)   ;  must be zero 
  596.    (remaining :SIGNED-LONG)
  597.    (originalIndex :SIGNED-INTEGER)
  598.    (recipientOffsetFlags :UNSIGNED-BYTE)
  599.    )
  600.  
  601. ; replyQueue works like recipient. [can no longer read it via ReadHeader]
  602. ; OriginalIndex is meaningless, rcptFlags are used seperately and there are
  603. ; currently none defined.
  604. (%define-record :IPMREADREPLYQUEUEPB (find-record-descriptor :IPMREADRECIPIENTPB))
  605.  
  606. (defrecord IPMGetBlkIndexPB 
  607.    (qLink :POINTER)
  608.    (reservedH1 :SIGNED-LONG)
  609.    (reservedH2 :SIGNED-LONG)
  610.    (ioCompletion :POINTER)
  611.    (ioResult :SIGNED-INTEGER)
  612.    (saveA5 :SIGNED-LONG)
  613.    (reqCode :SIGNED-INTEGER)
  614.  
  615.    (msgRef :SIGNED-LONG)
  616.    (blockType :OCECREATORTYPE)
  617.    (index :SIGNED-INTEGER)
  618.    (startingFrom :SIGNED-INTEGER)
  619.    (actualBlockType :OCECREATORTYPE)
  620.    (actualBlockIndex :SIGNED-INTEGER)
  621.    )
  622.  
  623. (defrecord IPMReadMsgPB 
  624.    (qLink :POINTER)
  625.    (reservedH1 :SIGNED-LONG)
  626.    (reservedH2 :SIGNED-LONG)
  627.    (ioCompletion :POINTER)
  628.    (ioResult :SIGNED-INTEGER)
  629.    (saveA5 :SIGNED-LONG)
  630.    (reqCode :SIGNED-INTEGER)
  631.  
  632.    (msgRef :SIGNED-LONG)
  633.    (mode :SIGNED-INTEGER)
  634.    (offset :SIGNED-LONG)
  635.    (count :SIGNED-LONG)
  636.    (buffer :POINTER)
  637.    (actualCount :SIGNED-LONG)
  638.    (blockIndex :SIGNED-INTEGER)
  639.    (remaining :SIGNED-LONG)
  640.    )
  641.  
  642. (defrecord IPMVerifySignaturePB 
  643.    (qLink :POINTER)
  644.    (reservedH1 :SIGNED-LONG)
  645.    (reservedH2 :SIGNED-LONG)
  646.    (ioCompletion :POINTER)
  647.    (ioResult :SIGNED-INTEGER)
  648.    (saveA5 :SIGNED-LONG)
  649.    (reqCode :SIGNED-INTEGER)
  650.  
  651.    (msgRef :SIGNED-LONG)
  652.    (signatureContext :SIGCONTEXTPTR)
  653.    )
  654.  
  655. (defrecord IPMNewMsgPB 
  656.    (qLink :POINTER)
  657.    (reservedH1 :SIGNED-LONG)
  658.    (reservedH2 :SIGNED-LONG)
  659.    (ioCompletion :POINTER)
  660.    (ioResult :SIGNED-INTEGER)
  661.    (saveA5 :SIGNED-LONG)
  662.    (reqCode :SIGNED-INTEGER)
  663.  
  664.    (filler :SIGNED-LONG)
  665.    (recipient (:POINTER :DSSPEC))
  666.    (replyQueue (:POINTER :DSSPEC))
  667.    (procHint (:POINTER (:STRING 255)))
  668.    (filler2 :SIGNED-INTEGER)
  669.    (msgType (:POINTER :IPMMSGTYPE))
  670.    (refCon :SIGNED-LONG)
  671.    (newMsgRef :SIGNED-LONG)
  672.    (filler3 :SIGNED-INTEGER)
  673.    (filler4 :SIGNED-LONG)
  674.    (identity :SIGNED-LONG)
  675.    (sender (:POINTER :IPMSENDER))
  676.    (internalUse :SIGNED-LONG)
  677.    (internalUse2 :SIGNED-LONG)
  678.    )
  679.  
  680. (defrecord IPMNewHFSMsgPB 
  681.    (qLink :POINTER)
  682.    (reservedH1 :SIGNED-LONG)
  683.    (reservedH2 :SIGNED-LONG)
  684.    (ioCompletion :POINTER)
  685.    (ioResult :SIGNED-INTEGER)
  686.    (saveA5 :SIGNED-LONG)
  687.    (reqCode :SIGNED-INTEGER)
  688.  
  689.    (hfsPath (:POINTER :FSSPEC))
  690.    (recipient (:POINTER :DSSPEC))
  691.    (replyQueue (:POINTER :DSSPEC))
  692.    (procHint (:POINTER (:STRING 255)))
  693.    (filler2 :SIGNED-INTEGER)
  694.    (msgType (:POINTER :IPMMSGTYPE))
  695.    (refCon :SIGNED-LONG)
  696.    (newMsgRef :SIGNED-LONG)
  697.    (filler3 :SIGNED-INTEGER)
  698.    (filler4 :SIGNED-LONG)
  699.    (identity :SIGNED-LONG)
  700.    (sender (:POINTER :IPMSENDER))
  701.    (internalUse :SIGNED-LONG)
  702.    (internalUse2 :SIGNED-LONG)
  703.    )
  704.  
  705. (defrecord IPMNestMsgPB 
  706.    (qLink :POINTER)
  707.    (reservedH1 :SIGNED-LONG)
  708.    (reservedH2 :SIGNED-LONG)
  709.    (ioCompletion :POINTER)
  710.    (ioResult :SIGNED-INTEGER)
  711.    (saveA5 :SIGNED-LONG)
  712.    (reqCode :SIGNED-INTEGER)
  713.  
  714.    (msgRef :SIGNED-LONG)
  715.    (filler (:ARRAY :SIGNED-INTEGER (- 9 1 -1)))
  716.    (refCon :SIGNED-LONG)
  717.    (msgToNest :SIGNED-LONG)
  718.    (filler2 :SIGNED-INTEGER)
  719.    (startingOffset :SIGNED-LONG)
  720.    )
  721.  
  722. (defrecord IPMNewNestedMsgBlockPB 
  723.    (qLink :POINTER)
  724.    (reservedH1 :SIGNED-LONG)
  725.    (reservedH2 :SIGNED-LONG)
  726.    (ioCompletion :POINTER)
  727.    (ioResult :SIGNED-INTEGER)
  728.    (saveA5 :SIGNED-LONG)
  729.    (reqCode :SIGNED-INTEGER)
  730.  
  731.    (msgRef :SIGNED-LONG)
  732.    (recipient (:POINTER :DSSPEC))
  733.    (replyQueue (:POINTER :DSSPEC))
  734.    (procHint (:POINTER (:STRING 255)))
  735.    (filler1 :SIGNED-INTEGER)
  736.    (msgType (:POINTER :IPMMSGTYPE))
  737.    (refCon :SIGNED-LONG)
  738.    (newMsgRef :SIGNED-LONG)
  739.    (filler2 :SIGNED-INTEGER)
  740.    (startingOffset :SIGNED-LONG)
  741.    (identity :SIGNED-LONG)
  742.    (sender (:POINTER :IPMSENDER))
  743.    (internalUse :SIGNED-LONG)
  744.    (internalUse2 :SIGNED-LONG)
  745.    )
  746.  
  747. (defrecord IPMEndMsgPB 
  748.    (qLink :POINTER)
  749.    (reservedH1 :SIGNED-LONG)
  750.    (reservedH2 :SIGNED-LONG)
  751.    (ioCompletion :POINTER)
  752.    (ioResult :SIGNED-INTEGER)
  753.    (saveA5 :SIGNED-LONG)
  754.    (reqCode :SIGNED-INTEGER)
  755.  
  756.    (msgRef :SIGNED-LONG)
  757.    (msgID :IPMMSGID)
  758.    (msgTitle (:POINTER :RSTRING))
  759.    (deliveryNotification :UNSIGNED-BYTE)
  760.    (priority :UNSIGNED-BYTE)
  761.  
  762. ; ERROR!! Record field CANCEL declared PACKED BOOLEAN !
  763.    (cancel :BOOLEAN)
  764.    (padByte :UNSIGNED-BYTE)
  765.    (reserved :SIGNED-LONG)
  766.    (signature :SIGSIGNATUREPTR)
  767.    (signatureSize :SIZE)
  768.    (signatureContext :SIGCONTEXTPTR)
  769.    (family :OSTYPE)             ;  family this msg belongs (e.g. mail) 
  770. ;  use kIPMFamilyUnspecified by default 
  771.    )
  772.  
  773. (defrecord IPMAddRecipientPB 
  774.    (qLink :POINTER)
  775.    (reservedH1 :SIGNED-LONG)
  776.    (reservedH2 :SIGNED-LONG)
  777.    (ioCompletion :POINTER)
  778.    (ioResult :SIGNED-INTEGER)
  779.    (saveA5 :SIGNED-LONG)
  780.    (reqCode :SIGNED-INTEGER)
  781.  
  782.    (msgRef :SIGNED-LONG)
  783.    (recipient (:POINTER :DSSPEC))
  784.    (reserved :SIGNED-LONG)
  785.    )
  786.  
  787. (defrecord IPMAddReplyQueuePB 
  788.    (qLink :POINTER)
  789.    (reservedH1 :SIGNED-LONG)
  790.    (reservedH2 :SIGNED-LONG)
  791.    (ioCompletion :POINTER)
  792.    (ioResult :SIGNED-INTEGER)
  793.    (saveA5 :SIGNED-LONG)
  794.    (reqCode :SIGNED-INTEGER)
  795.  
  796.    (msgRef :SIGNED-LONG)
  797.    (filler :SIGNED-LONG)
  798.    (replyQueue (:POINTER :DSSPEC))
  799.    )
  800.  
  801. (defrecord IPMNewBlockPB 
  802.    (qLink :POINTER)
  803.    (reservedH1 :SIGNED-LONG)
  804.    (reservedH2 :SIGNED-LONG)
  805.    (ioCompletion :POINTER)
  806.    (ioResult :SIGNED-INTEGER)
  807.    (saveA5 :SIGNED-LONG)
  808.    (reqCode :SIGNED-INTEGER)
  809.  
  810.    (msgRef :SIGNED-LONG)
  811.    (blockType :OCECREATORTYPE)
  812.    (filler (:ARRAY :SIGNED-INTEGER (- 5 1 -1)))
  813.    (refCon :SIGNED-LONG)
  814.    (filler2 (:ARRAY :SIGNED-INTEGER (- 3 1 -1)))
  815.    (startingOffset :SIGNED-LONG)
  816.    )
  817.  
  818. (defrecord IPMWriteMsgPB 
  819.    (qLink :POINTER)
  820.    (reservedH1 :SIGNED-LONG)
  821.    (reservedH2 :SIGNED-LONG)
  822.    (ioCompletion :POINTER)
  823.    (ioResult :SIGNED-INTEGER)
  824.    (saveA5 :SIGNED-LONG)
  825.    (reqCode :SIGNED-INTEGER)
  826.  
  827.    (msgRef :SIGNED-LONG)
  828.    (mode :SIGNED-INTEGER)
  829.    (offset :SIGNED-LONG)
  830.    (count :SIGNED-LONG)
  831.    (buffer :POINTER)
  832.    (actualCount :SIGNED-LONG)
  833.    (currentBlock :BOOLEAN)
  834.    )
  835.  
  836. (defrecord IPMParamBlock 
  837.    (:variant 
  838.       ((header :IPMPARAMHEADER))
  839.       ((openContextPB :IPMOPENCONTEXTPB))
  840.       ((closeContextPB :IPMOPENCONTEXTPB))
  841.       ((createQueuePB :IPMCREATEQUEUEPB))
  842.       ((deleteQueuePB :IPMCREATEQUEUEPB))
  843.       ((openQueuePB :IPMOPENQUEUEPB))
  844.       ((closeQueuePB :IPMCLOSEQUEUEPB))
  845.       ((enumerateQueuePB :IPMENUMERATEQUEUEPB))
  846.       ((changeQueueFilterPB :IPMENUMERATEQUEUEPB))
  847.       ((deleteMsgRangePB :IPMDELETEMSGRANGEPB))
  848.       ((openMsgPB :IPMOPENMSGPB))
  849.       ((openHFSMsgPB :IPMOPENHFSMSGPB))
  850.       ((openBlockAsMsgPB :IPMOPENBLOCKASMSGPB))
  851.       ((closeMsgPB :IPMCLOSEMSGPB))
  852.       ((getMsgInfoPB :IPMGETMSGINFOPB))
  853.       ((readHeaderPB :IPMREADHEADERPB))
  854.       ((readRecipientPB :IPMREADRECIPIENTPB))
  855.       ((readReplyQueuePB :IPMREADRECIPIENTPB))
  856.       ((getBlkIndexPB :IPMGETBLKINDEXPB))
  857.       ((readMsgPB :IPMREADMSGPB))
  858.       ((verifySignaturePB :IPMVERIFYSIGNATUREPB))
  859.       ((newMsgPB :IPMNEWMSGPB))
  860.       ((newHFSMsgPB :IPMNEWHFSMSGPB))
  861.       ((nestMsgPB :IPMNESTMSGPB))
  862.       ((newNestedMsgBlockPB :IPMNEWNESTEDMSGBLOCKPB))
  863.       ((endMsgPB :IPMENDMSGPB))
  864.       ((addRecipientPB :IPMADDRECIPIENTPB))
  865.       ((addReplyQueuePB :IPMADDREPLYQUEUEPB))
  866.       ((newBlockPB :IPMNEWBLOCKPB))
  867.       ((writeMsgPB :IPMWRITEMSGPB))
  868.       ))
  869.  
  870. (def-mactype :IPMPARAMBLOCKPTR (find-mactype :POINTER))
  871.  
  872. ;     Request codes 
  873. (defconstant $kIPMOpenContext #X400)
  874. (defconstant $kIPMCloseContext #X401)
  875. (defconstant $kIPMNewMsg #X402)
  876. (defconstant $kIPMAddRecipient #X403)
  877. (defconstant $kIPMNewBlock #X404)
  878. (defconstant $kIPMNewNestedMsgBlock #X405)
  879. (defconstant $kIPMNestMsg #X406)
  880. (defconstant $kIPMWriteMsg #X407)
  881. (defconstant $kIPMEndMsg #X408)
  882. (defconstant $kIPMOpenQueue #X409)
  883. (defconstant $kIPMCloseQueue #X40A)
  884. (defconstant $kIPMOpenMsg #X40B)
  885. (defconstant $kIPMCloseMsg #X40C)
  886. (defconstant $kIPMReadMsg #X40D)
  887. (defconstant $kIPMReadHeader #X40E)
  888. (defconstant $kIPMOpenBlockAsMsg #X40F)
  889. (defconstant $kIPMReadRecipient #X410)
  890. (defconstant $kIPMCreateQueue #X411)
  891. (defconstant $kIPMDeleteQueue #X412)
  892. (defconstant $kIPMEnumerateQueue #X413)
  893. (defconstant $kIPMChangeQueueFilter #X414)
  894. (defconstant $kIPMDeleteMsgRange #X415)
  895. (defconstant $kIPMOpenHFSMsg #X417)
  896. (defconstant $kIPMGetBlkIndex #X418)
  897. (defconstant $kIPMGetMsgInfo #X419)
  898.  
  899. (defconstant $kIPMAddReplyQueue #X41D)
  900. (defconstant $kIPMNewHFSMsg #X41E)
  901.  
  902. (defconstant $kIPMReadReplyQueue #X421)
  903. (defconstant $kIPMVerifySignature #X422)
  904.  
  905.  
  906. (deftrap _ipmopencontext ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  907.    (:stack :signed-integer)
  908.    (:stack-trap #xAA5E paramblock async (1024 :signed-integer)))
  909.  
  910.  
  911. (deftrap _ipmclosecontext ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  912.    (:stack :signed-integer)
  913.    (:stack-trap #xAA5E paramblock async (1025 :signed-integer)))
  914.  
  915.  
  916. (deftrap _ipmnewmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  917.    (:stack :signed-integer)
  918.    (:stack-trap #xAA5E paramblock async (1026 :signed-integer)))
  919.  
  920.  
  921. (deftrap _ipmnewblock ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  922.    (:stack :signed-integer)
  923.    (:stack-trap #xAA5E paramblock async (1028 :signed-integer)))
  924.  
  925.  
  926. (deftrap _ipmnewnestedmsgblock ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  927.    (:stack :signed-integer)
  928.    (:stack-trap #xAA5E paramblock async (1029 :signed-integer)))
  929.  
  930.  
  931. (deftrap _ipmnestmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  932.    (:stack :signed-integer)
  933.    (:stack-trap #xAA5E paramblock async (1030 :signed-integer)))
  934.  
  935.  
  936. (deftrap _ipmwritemsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  937.    (:stack :signed-integer)
  938.    (:stack-trap #xAA5E paramblock async (1031 :signed-integer)))
  939.  
  940.  
  941. (deftrap _ipmendmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  942.    (:stack :signed-integer)
  943.    (:stack-trap #xAA5E paramblock async (1032 :signed-integer)))
  944.  
  945.  
  946. (deftrap _ipmopenqueue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  947.    (:stack :signed-integer)
  948.    (:stack-trap #xAA5E paramblock async (1033 :signed-integer)))
  949.  
  950.  
  951. (deftrap _ipmclosequeue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  952.    (:stack :signed-integer)
  953.    (:stack-trap #xAA5E paramblock async (1034 :signed-integer)))
  954.  
  955.  
  956. (deftrap _ipmverifysignature ((paramblock (:pointer :ipmparamblock)))
  957.    (:stack :signed-integer)
  958.    (:stack-trap #xAA5E paramblock (69337088 :signed-longint)))
  959.  
  960.  
  961. (deftrap _ipmopenmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  962.    (:stack :signed-integer)
  963.    (:stack-trap #xAA5E paramblock async (1035 :signed-integer)))
  964.  
  965.  
  966. (deftrap _ipmclosemsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  967.    (:stack :signed-integer)
  968.    (:stack-trap #xAA5E paramblock async (1036 :signed-integer)))
  969.  
  970.  
  971. (deftrap _ipmreadmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  972.    (:stack :signed-integer)
  973.    (:stack-trap #xAA5E paramblock async (1037 :signed-integer)))
  974.  
  975.  
  976. (deftrap _ipmreadheader ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  977.    (:stack :signed-integer)
  978.    (:stack-trap #xAA5E paramblock async (1038 :signed-integer)))
  979.  
  980.  
  981. (deftrap _ipmopenblockasmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  982.    (:stack :signed-integer)
  983.    (:stack-trap #xAA5E paramblock async (1039 :signed-integer)))
  984.  
  985.  
  986. (deftrap _ipmnewhfsmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  987.    (:stack :signed-integer)
  988.    (:stack-trap #xAA5E paramblock async (1054 :signed-integer)))
  989.  
  990.  
  991. (deftrap _ipmreadrecipient ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  992.    (:stack :signed-integer)
  993.    (:stack-trap #xAA5E paramblock async (1040 :signed-integer)))
  994.  
  995.  
  996. (deftrap _ipmreadreplyqueue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  997.    (:stack :signed-integer)
  998.    (:stack-trap #xAA5E paramblock async (1057 :signed-integer)))
  999.  
  1000.  
  1001. (deftrap _ipmcreatequeue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1002.    (:stack :signed-integer)
  1003.    (:stack-trap #xAA5E paramblock async (1041 :signed-integer)))
  1004.  
  1005.  
  1006. (deftrap _ipmdeletequeue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1007.    (:stack :signed-integer)
  1008.    (:stack-trap #xAA5E paramblock async (1042 :signed-integer)))
  1009.  
  1010.  
  1011. (deftrap _ipmenumeratequeue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1012.    (:stack :signed-integer)
  1013.    (:stack-trap #xAA5E paramblock async (1043 :signed-integer)))
  1014.  
  1015.  
  1016. (deftrap _ipmchangequeuefilter ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1017.    (:stack :signed-integer)
  1018.    (:stack-trap #xAA5E paramblock async (1044 :signed-integer)))
  1019.  
  1020.  
  1021. (deftrap _ipmdeletemsgrange ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1022.    (:stack :signed-integer)
  1023.    (:stack-trap #xAA5E paramblock async (1045 :signed-integer)))
  1024.  
  1025.  
  1026. (deftrap _ipmaddrecipient ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1027.    (:stack :signed-integer)
  1028.    (:stack-trap #xAA5E paramblock async (1027 :signed-integer)))
  1029.  
  1030.  
  1031. (deftrap _ipmaddreplyqueue ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1032.    (:stack :signed-integer)
  1033.    (:stack-trap #xAA5E paramblock async (1053 :signed-integer)))
  1034.  
  1035.  
  1036. (deftrap _ipmopenhfsmsg ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1037.    (:stack :signed-integer)
  1038.    (:stack-trap #xAA5E paramblock async (1047 :signed-integer)))
  1039.  
  1040.  
  1041. (deftrap _ipmgetblkindex ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1042.    (:stack :signed-integer)
  1043.    (:stack-trap #xAA5E paramblock async (1048 :signed-integer)))
  1044.  
  1045.  
  1046. (deftrap _ipmgetmsginfo ((paramblock (:pointer :ipmparamblock)) (async :boolean))
  1047.    (:stack :signed-integer)
  1048.    (:stack-trap #xAA5E paramblock async (1049 :signed-integer)))
  1049.  
  1050. ; **************************************************************************************
  1051. ;  EXTERNAL ROUTINES 
  1052.  
  1053. (defconstant $kOCESizePackedRecipient 830)
  1054. (defconstant $kOCEPackRecipient 831)
  1055. (defconstant $kOCEUnpackRecipient 832)
  1056. (defconstant $kOCEStreamRecipient 833)
  1057. (defconstant $kOCEGetRecipientType 834)
  1058. (defconstant $kOCESetRecipientType 835)
  1059.  
  1060. ; Compute the space that a OCERecipient would take if it were in packed
  1061. ; form.  [Note: does NOT even pad extensionSize, so you may get an odd #back out]
  1062. ; Safe to pass dereferenced handle(s).
  1063.  
  1064.  
  1065. (deftrap _ocesizepackedrecipient ((rcpt :dsspec))
  1066.    (:stack :signed-integer)
  1067.    (:stack-trap #xAA5C :d0 830 rcpt))
  1068.  
  1069. ; Take an OCERecipient (scatter) and (gather) stream into the specified
  1070. ; buffer.  It is assumed that there is sufficient space in the buffer (that is
  1071. ; OCESizePackedRecipient).  Safe to pass dereferenced handle(s).
  1072.  
  1073. (deftrap _ocepackrecipient ((rcpt :dsspec) (buffer :pointer))
  1074.    (:stack :signed-integer)
  1075.    (:stack-trap #xAA5C :d0 831 rcpt buffer))
  1076.  
  1077. ; Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
  1078. ; amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
  1079. ; handle(s).
  1080.  
  1081. (deftrap _oceunpackrecipient ((buffer :pointer) (rcpt (:pointer :dsspec)) (entityspecifier (:pointer :recordid)))
  1082.    (:stack :signed-integer)
  1083.    (:stack-trap #xAA5C :d0 832 buffer rcpt entityspecifier))
  1084.  
  1085. ; Take an OCERecipient (scatter) and (gather) stream using the specified
  1086. ; function.  Safe to pass dereferenced handle(s).  If streamer function returns
  1087. ; OCEError OCEStreamRecipient stops execution and passes the error back to the caller
  1088.  
  1089. (def-mactype :OCERECIPIENTSTREAMER (find-mactype :POINTER))
  1090. ;  FUNCTION OCERecipientStreamer(
  1091. ;         VAR buffer: void; count: LONGINT; eof: BOOLEAN; userData: LONGINT): OSErr;
  1092.  
  1093.  
  1094. (deftrap _ocestreamrecipient ((rcpt :dsspec) (stream :pointer) (userdata :signed-long) (actualcount (:pointer :signed-long)))
  1095.    (:stack :signed-integer)
  1096.    (:stack-trap #xAA5C :d0 833 rcpt stream userdata actualcount))
  1097.  
  1098. ;  Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).
  1099.  
  1100.  
  1101. (deftrap _ocegetrecipienttype ((cid :creationid))
  1102.    (:stack :ostype)
  1103.    (:stack-trap #xAA5C :d0 834 cid))
  1104.  
  1105. ; Set the OCERecipient's extensionType in the specified cid.  (Note: we do NOT
  1106. ; check for a nil pointer).  If the extensionType is 'entn', the cid is assumed
  1107. ; to be "valid" and is not touched.  Note: to properly handle non 'entn''s this
  1108. ; routine must and will zero the high LONGINT (source) of the cid! Safe to pass
  1109. ; dereferenced handle(s).
  1110.  
  1111. (deftrap _ocesetrecipienttype ((extensiontype :ostype) (cid (:pointer :creationid)))
  1112.    nil
  1113.    (:stack-trap #xAA5C :d0 835 extensiontype cid))
  1114.  
  1115. ; $ENDC                         ;  UsingOCEMessaging 
  1116.  
  1117. ; $IFC NOT UsingIncludes
  1118.  
  1119. ; $ENDC
  1120.  
  1121. (export '($KOCESETRECIPIENTTYPE $KOCEGETRECIPIENTTYPE $KOCESTREAMRECIPIENT
  1122.           $KOCEUNPACKRECIPIENT $KOCEPACKRECIPIENT $KOCESIZEPACKEDRECIPIENT
  1123.           $KIPMVERIFYSIGNATURE $KIPMREADREPLYQUEUE $KIPMNEWHFSMSG
  1124.           $KIPMADDREPLYQUEUE $KIPMGETMSGINFO $KIPMGETBLKINDEX $KIPMOPENHFSMSG
  1125.           $KIPMDELETEMSGRANGE $KIPMCHANGEQUEUEFILTER $KIPMENUMERATEQUEUE
  1126.           $KIPMDELETEQUEUE $KIPMCREATEQUEUE $KIPMREADRECIPIENT
  1127.           $KIPMOPENBLOCKASMSG $KIPMREADHEADER $KIPMREADMSG $KIPMCLOSEMSG
  1128.           $KIPMOPENMSG $KIPMCLOSEQUEUE $KIPMOPENQUEUE $KIPMENDMSG $KIPMWRITEMSG
  1129.           $KIPMNESTMSG $KIPMNEWNESTEDMSGBLOCK $KIPMNEWBLOCK $KIPMADDRECIPIENT
  1130.           $KIPMNEWMSG $KIPMCLOSECONTEXT $KIPMOPENCONTEXT
  1131.           $KIPMNOTRANSFERMSGTOOLARGE $KIPMNOTRANSFERMSGREJECTEDBYDEST
  1132.           $KIPMNOTRANSFERDISKFULL $KIPMRECIPIENTREQSNAPSHOT
  1133.           $KIPMRECIPIENTREQSTDCONT $KIPMMSGNOTRANSLATABLECONTENT
  1134.           $KIPMMSGEXPIRED $KIPMMSGUNREADABLE $KIPMGROUPEXPANSIONPROBLEM
  1135.           $KIPMRECIPIENTACCESSDENIED $KIPMRECIPIENTAMBIGUOUS
  1136.           $KIPMRECIPIENTMALFORMED $KIPMNOSUCHRECIPIENT
  1137.           $KIPMENCLOSEORIGINALONERRORMASK $KIPMORIGINALONLYONERRORMASK
  1138.           $KIPMSUMMARYREPORTMASK $KIPMIMMEDIATEREPORTMASK
  1139.           $KIPMENCLOSEORIGINALMASK $KIPMDONTENCLOSEORIGINALMASK
  1140.           $KIPMNONDELIVERYNOTIFICATIONMASK $KIPMDELIVERYNOTIFICATIONMASK
  1141.           $KIPMNONOTIFICATIONMASK $KIPMORIGINALONLYONERRORBIT
  1142.           $KIPMSUMMARYREPORTBIT $KIPMENCLOSEORIGINALBIT
  1143.           $KIPMNONDELIVERYNOTIFICATIONBIT $KIPMDELIVERYNOTIFICATIONBIT
  1144.           $KIPMFIXEDINFO $KIPMMESSAGETYPE $KIPMMESSAGETITLE $KIPMPROCESSHINT
  1145.           $KIPMSENDER $KIPMTOC $KIPMWSRECEIVERNBPTYPE
  1146.           $KOCEPACKEDRECIPIENTMAXBYTES $KOCEDONTUSEHANDYDIAL $KOCEUSEHANDYDIAL
  1147.           $KOCESPATXTN $KOCEATTRXTN $KOCEQNAMXTN $KOCEADDRXTN $KOCEAPHNXTN
  1148.           $KOCEENTNXTN $KOCEALANXTN $KIPMSTRINGFORMATTYPE $KIPMOSFORMATTYPE
  1149.           $KIPMDIGITALSIGNATURE $KIPMREPORTINFO $KIPMENCLOSEDMSGTYPE
  1150.           $KIPMREPORTNOTIFY $KIPMSIGNATURE $KIPMFAMILYWILDCARD
  1151.           $KIPMFAMILYUNSPECIFIED $KIPMTYPEWILDCARD $KIPMBCCRECMASK
  1152.           $KIPMREPORTERRECMASK $KIPMFEEDBACKRECMASK $KIPMDUMMYRECMASK
  1153.           $KIPMFROMDISTLISTMASK $KIPMBCCRECBIT $KIPMREPORTERRECBIT
  1154.           $KIPMFEEDBACKRECBIT $KIPMDUMMYRECBIT $KIPMFROMDISTLISTBIT
  1155.           $KIPMSENDERRECORDIDTAG $KIPMSENDERRSTRINGTAG $KIPMDELETEMSGMASK
  1156.           $KIPMNEWMSGMASK $KIPMUPDATEMSGMASK $KIPMDELETEMSGBIT $KIPMNEWMSGBIT
  1157.           $KIPMUPDATEMSGBIT $KIPMFROMMARK $KIPMFROMLEOM $KIPMFROMSTART
  1158.           $KIPMATMARK $KIPMNORMALPRIORITY $KIPMANYPRIORITY))
  1159. (provide-interface 'OCEMessaging)